function y = g_t1(x)
%Generalized Tridiagonal-1 Function
%x0=[2,2,...,2] 
%fmin=n/2
%Author:shi yangyang
n=length(x);
y=ones(n-1,1);
u = zeros(n-1,1); v = u;
for i=1:1:n-1
    u(i)=x(i)+x(i+1)-3.0;
    v(i)=x(i)-x(i+1)+1.0;
    y(i)=u(i)^2+v(i)^4;
end
y=sum(y);